home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
pdcurs21.zip
/
PORTABLE.ZIP
/
UNGETCH.C
< prev
next >
Wrap
Text File
|
1992-11-21
|
1KB
|
47 lines
#define CURSES_LIBRARY 1
#include <curses.h>
#undef ungetch
#ifndef NDEBUG
char *rcsid_ungetch = "$Header: c:/curses/portable/RCS/ungetch.c%v 2.0 1992/11/15 03:29:20 MH Rel $";
#endif
/*man-start*********************************************************************
ungetch() - pushes a character back onto the input stream
PDCurses Description:
There is only one input stream to ungetch characters onto. It
is of size NUNGETCH.
PDCurses Return Value:
The ungetch() routine returns OK upon success otherwise ERR is
returned.
PDCurses Errors:
ERR will be returned when the push back stack is full.
Portability:
PDCurses ungetch( chtype ch );
SysV Curses
BSD Curses
**man-end**********************************************************************/
int ungetch(chtype ch)
{
extern int c_pindex; /* putter index */
extern int c_gindex; /* getter index */
extern int c_ungind; /* wungetch() push index */
extern chtype c_ungch[NUNGETCH]; /* array of ungotten chars */
if (c_ungind >= NUNGETCH) /* pushback stack full */
return( ERR );
c_ungch[c_ungind++] = ch;
return( OK );
}